<?php

require_once BASE_PATH.'application/models/basedao'.EXT;
class emailDAO extends baseDAO {
	
	function __construct()
	{
            
	    // Call the Model constructor
	    parent::__construct();
		$this->load->library('email');
	}
	
	function email($data){
		
		$this->email->from($data['fromEmail'], $data['fromName']);
		$this->email->to($data['toEmail']);
		
		if(!empty($data['ccEmail']))
			$this->email->cc($data['ccEmail']);
		
		if(!empty($data['bccEmail']))
			$this->email->bcc($data['bccEmail']);
		
		$this->email->subject($data['subject']);
		$this->email->message($data['message']);
		$this->email->send();
		//return($this->email->send());
		return TRUE;
	}
	
}